import request from '@/config/axios'

// VIP套餐 VO
export interface VipSetMealVO {
  id: number // 编号
  name: string // 名称
  duration: number // 时长（天）
  price: number // 魔豆价格
  downloadCount: number // 下载次数
  remark: string // 备注
}

// VIP套餐 API
export const VipSetMealApi = {
  // 查询VIP套餐分页
  getVipSetMealPage: async (params: any) => {
    return await request.get({ url: `/member/vip-set-meal/page`, params })
  },

  // 查询VIP套餐详情
  getVipSetMeal: async (id: number) => {
    return await request.get({ url: `/member/vip-set-meal/get?id=` + id })
  },

  // 新增VIP套餐
  createVipSetMeal: async (data: VipSetMealVO) => {
    return await request.post({ url: `/member/vip-set-meal/create`, data })
  },

  // 修改VIP套餐
  updateVipSetMeal: async (data: VipSetMealVO) => {
    return await request.put({ url: `/member/vip-set-meal/update`, data })
  },

  // 删除VIP套餐
  deleteVipSetMeal: async (id: number) => {
    return await request.delete({ url: `/member/vip-set-meal/delete?id=` + id })
  },

  // 导出VIP套餐 Excel
  exportVipSetMeal: async (params) => {
    return await request.download({ url: `/member/vip-set-meal/export-excel`, params })
  }
}